#pragma once

#include "ScriptCompiler/AST/SentenceNode.h"

class CExpressionNode;
class CSentenceBlockNode;

class CIfNode : public CSentenceNode
{
public:
    CIfNode(std::weak_ptr<CScriptFileContext> InFile)
        : CSentenceNode(InFile, EASTNodeType::If)
    {
    }

    std::shared_ptr<CScriptToken> If;

    //condition
    std::shared_ptr<CExpressionNode> Condition;

    //true branch
    std::shared_ptr<CSentenceBlockNode> TrueBranch;

    //false branch
    std::shared_ptr<CSentenceBlockNode> FalseBranch;
    
    virtual void DebugPrint(int32_t InDepth) override;

    virtual std::shared_ptr<CScriptToken> GetFirstToken() override { return If; }
};